<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<table border="1" cellspacing="" cellpadding="">
			<tr><th>id</th><th>name</th></tr>
		</table>
		<script src="../js/jquery-3.5.1.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			$.post("http://localhost:8080/postdemo",{
				account:"hh",
				password:"123"
			},function(result,suc,response){
				let json = JSON.parse(result);
				console.log(json);
				//$each(数组名,fn);JQ提供数组遍历函数
				$.each(function(index,item){
					console.log(index,item);
					let te = `<tr><td><${item.id}></td><td><${item.naem}></td><td><${item.age></td></tr>`
					$("table").append(tr);
				});
			});
			// function myeach(arr,fn){
			// 	for(let index in arr){
			// 		let item = arr[index];
			// 		fn(index,item);
			// 	}
			// }
		</script>
	</body>
</html>
